<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8">
	<title>TooltipDialog Widget Automated (non-robot) Tests</title>

	<style type="text/css">
		@import "../../../themes/claro/document.css";
		@import "../../css/dijitTests.css";
	</style>

	<!-- required: a default dijit theme: -->
	<link id="themeStyles" rel="stylesheet" href="../../../themes/claro/claro.css"/>

	<!-- required: dojo.js -->
	<script type="text/javascript" src="../../../../dojo/dojo.js"
			data-dojo-config="async: true, has: { 'dojo-bidi': true }"></script>

	<script type="text/javascript">
		require([
			"doh/runner",
			"dijit/registry",
			"dijit/TooltipDialog",
			"dijit/popup",
			"dojo/domReady!"
		], function(doh, registry, TooltipDialog, popup){

			// Setup intentional global
			toggleTextDir = function(){
				var td = registry.byId("td");
				td.set("textDir", (td.get("textDir") !== "rtl") ? "rtl" : "ltr");
			};

			doh.register("tests._BidiSupport.misc.TooltipDialog", [
				{
					name: "Bidi TooltipDialog test",
					runTest: function(){
						var d = new doh.Deferred();
						var td = new TooltipDialog({
							id: "td",
							textDir: "rtl",
							title: "Title!",
							content:
								"<input id='dlg1_inputA'><br>" +
								"<input id='dlg1_inputB'><br>" +
								"<input id='dlg1_inputC'><br>" +
								"<input type='button' value='Toggle title textDir' onclick='toggleTextDir();'>"
						});
						popup.open({
							popup: td,
							x: 10,
							y: 50
						});
						doh.is(String.fromCharCode(8235), td.containerNode.title.charAt(0), "Dialog title tooltip should have direction correspondent to dialog's 'textDir'");
					}
				}
			]);

			doh.run();
		});
	</script>
</head>
<body class="claro">
	<h1 class="testTitle">Bidi TooltipDialog Test</h1>
</body>
</html>


